<template>
  <div class="banner">
    Tags
  </div>
  <br>
  <el-row>
    <el-col :span="4"></el-col>
    <el-col :span="16">
      <el-card style="text-align: center;">
        <p style="font-size: 2.5em;margin: 10px">所有标签</p>
        <el-space wrap spacer="|">
          <a v-for="tag in tags"
             :href="'/tag/'+tag.tagId"
             :style="{color:tag.tagColor}">{{ tag.tagName }}({{ tag.blogCount}})</a>
        </el-space>
      </el-card>
    </el-col>
    <el-col :span="4"></el-col>
  </el-row>
</template>

<script>
export default {
  name: "Tag",
  created() {
    this.init()
  },
  data() {
    return {
      tags: []
    }
  },
  methods: {
    async init() {
      let {data: result} = await this.$http.get("/api/tag/getAllUseTags")
      this.tags = result
    }
  }
}
</script>

<style scoped>
.banner {
  background-image: url('/headImg/tag.jpeg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 400px;
  width: 100%;

  color: white;
  font-size: 3em;
  font-weight: bolder;
  text-align: center;
  padding-top: 200px;
}

a {
  /*color: #036b67;*/
  text-decoration-line: none;
  margin: 20px;
  font-size: 2em;
}
</style>